import java.util.HashMap;
import java.util.Map;

/**
 * Created by 84995 on 2020/1/16.
 */
public class test15 {

    public static void main(String[] args) {

        String str = "<Dog name='小白' color='白色'  sons='小黑,小花'/>";
        String s = str.substring(1, str.length() - 2).replace("'", "").replace("  ", " ").replace("Dog ","");

        Map<String,String> map=new HashMap<>();
        String[] split = s.split(" ");
        for (String s1 : split) {
            String[] split1 = s1.split("=");
            map.put(split1[0],split1[1]);
        }
        Dong d = new Dong();
        d.setNaem(map.get("name"));
        d.setColor(map.get("color"));

        String ss = map.get("sons");
        String[] aa = ss.split(",");
        for (String s1 : aa) {
            d.getList().add(s1);
        }

        System.out.println(d);
    }}




